# coding:utf-8
from app import BASE_URL

import requests
class DepartAPI:
    def __init__(self):
        self.url_depart_insert=BASE_URL+'/api/company/department'

        self.url_other=BASE_URL+'/api/company/department/{}'
    def insert_depart(self,token,depart_data):
        return requests.post(self.url_depart_insert,headers={'Authorization':token},json=depart_data)
    def delete_depart(self,id,token):
        return requests.delete(self.url_other.format(id),headers={'Authorization':token})
    def update_depart(self,id,token,updata_data):
        return requests.put(self.url_other.format(id),headers={'Authorization':token},json=updata_data)
    def select_depart(self,id,token):
        return requests.get(self.url_other.format(id),headers={'Authorization':token})

